package com.kgcx.common.utils;

import java.io.PrintWriter;
import java.io.StringWriter;

/**
 * @author 吴刚林
 * @date 2017/11/30
 */
public class ExceptionUtils {
    public static String getStackTrace(Throwable t) {
        StringWriter sw = new StringWriter();
        PrintWriter pw = new PrintWriter(sw);


        try {
            t.printStackTrace(pw);
            return sw.toString();
        } finally {
            pw.close();
        }
    }
}
